/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author SHERLY
 */
@Entity
@Table(name = "categoria")
@NamedQueries({
    @NamedQuery(name = "Categoria.findAll", query = "SELECT c FROM Categoria c"),
    @NamedQuery(name = "Categoria.findByNCtgId", query = "SELECT c FROM Categoria c WHERE c.nCtgId = :nCtgId"),
    @NamedQuery(name = "Categoria.findByVNombre", query = "SELECT c FROM Categoria c WHERE c.vNombre = :vNombre"),
    @NamedQuery(name = "Categoria.findByVDescripcion", query = "SELECT c FROM Categoria c WHERE c.vDescripcion = :vDescripcion"),
    @NamedQuery(name = "Categoria.findByNHoras", query = "SELECT c FROM Categoria c WHERE c.nHoras = :nHoras"),
    @NamedQuery(name = "Categoria.findByNDspHoras", query = "SELECT c FROM Categoria c WHERE c.nDspHoras = :nDspHoras"),
    @NamedQuery(name = "Categoria.findByNMinHoras", query = "SELECT c FROM Categoria c WHERE c.nMinHoras = :nMinHoras"),
    @NamedQuery(name = "Categoria.findByNMaxHoras", query = "SELECT c FROM Categoria c WHERE c.nMaxHoras = :nMaxHoras"),
    @NamedQuery(name = "Categoria.findByVEstado", query = "SELECT c FROM Categoria c WHERE c.vEstado = :vEstado")})
public class Categoria implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "nCtgId")
    private Integer nCtgId;
    @Size(max = 30)
    @Column(name = "vNombre")
    private String vNombre;
    @Size(max = 100)
    @Column(name = "vDescripcion")
    private String vDescripcion;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "nHoras")
    private BigDecimal nHoras;
    @Column(name = "nDspHoras")
    private BigDecimal nDspHoras;
    @Column(name = "nMinHoras")
    private BigDecimal nMinHoras;
    @Column(name = "nMaxHoras")
    private BigDecimal nMaxHoras;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "categoria")
    private List<Docentexcategoria> docentexcategoriaList;

    public Categoria() {
    }

    public Categoria(Integer nCtgId) {
        this.nCtgId = nCtgId;
    }

    public Integer getNCtgId() {
        return nCtgId;
    }

    public void setNCtgId(Integer nCtgId) {
        this.nCtgId = nCtgId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public String getVDescripcion() {
        return vDescripcion;
    }

    public void setVDescripcion(String vDescripcion) {
        this.vDescripcion = vDescripcion;
    }

    public BigDecimal getNHoras() {
        return nHoras;
    }

    public void setNHoras(BigDecimal nHoras) {
        this.nHoras = nHoras;
    }

    public BigDecimal getNDspHoras() {
        return nDspHoras;
    }

    public void setNDspHoras(BigDecimal nDspHoras) {
        this.nDspHoras = nDspHoras;
    }

    public BigDecimal getNMinHoras() {
        return nMinHoras;
    }

    public void setNMinHoras(BigDecimal nMinHoras) {
        this.nMinHoras = nMinHoras;
    }

    public BigDecimal getNMaxHoras() {
        return nMaxHoras;
    }

    public void setNMaxHoras(BigDecimal nMaxHoras) {
        this.nMaxHoras = nMaxHoras;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Docentexcategoria> getDocentexcategoriaList() {
        return docentexcategoriaList;
    }

    public void setDocentexcategoriaList(List<Docentexcategoria> docentexcategoriaList) {
        this.docentexcategoriaList = docentexcategoriaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nCtgId != null ? nCtgId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Categoria)) {
            return false;
        }
        Categoria other = (Categoria) object;
        if ((this.nCtgId == null && other.nCtgId != null) || (this.nCtgId != null && !this.nCtgId.equals(other.nCtgId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return vNombre;
    }
    
}
